package com.hp.airmap.input;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hp.airmap.R;
import com.hp.airmap.common.ImgLoader;
import com.hp.airmap.model.Photo;

import java.util.ArrayList;

/**
 * 日期：2016/12/11/011
 * 作者：胡鹏
 * 用途：
 */

public class MyAdapter extends BaseQuickAdapter<Photo, BaseViewHolder> {
    public MyAdapter(int itemLayoutId) {
        super(itemLayoutId, new ArrayList<Photo>());
    }

    @Override
    protected void convert(BaseViewHolder holder, Photo photo) {
        holder.setText(R.id.tvName,photo.title)
                .setText(R.id.tvDescribe,photo.describe);
        //显示图片
        ImgLoader.with(mContext,photo.url, (ImageView) holder.getView(R.id.ivPhoto));

    }
}
